home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Text⁄Files / FaceLift / FaceLift Folder / FLMapInfo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-16  |  2.6 KB  |  102 lines  |  [TEXT/KAHL]

  1. /*
  2.  * MapInfo.h - map structures
  3.  */
  4.  
  5. #ifndef    _MapInfo_
  6.  
  7. # define    _MapInfo_
  8.  
  9.  
  10. # define    maxPtSize    127        /* max legal point size within MacWrite */
  11.  
  12.  
  13. /*
  14.  * Font chosen is specified by its number in FontMgr.h.  If no font
  15.  * is chosen, use anyFont.
  16.  * Point size is one of 9, 10, 12, 14, 18 or 24, or none.  If none,
  17.  * use anySize.
  18.  */
  19.  
  20. # define    anyFont        (-1)
  21. # define    anySize        (-1)
  22.  
  23.  
  24. /*
  25.  * Style word coded as follows:  high bit never used in a legal MacWrite
  26.  * style spec, so it's used to signify "no style chosen".  If the high
  27.  * bit is set, others can be anything, but are ignored.  If it's clear
  28.  * the others are set according to the style attributes selected.  If
  29.  * no attributes are selected (low 7 bits = 0), that means plain.
  30.  *
  31.  * Warning:  these constants are specified for convience in coding,
  32.  * but the values are really hardcoded, since they're sometimes used
  33.  * in non-obvious ways.  See StyleToStr for an example.
  34.  */
  35.  
  36. typedef enum                /* bits used in style byte */
  37. {
  38.                             /* 0 = plain */
  39.     styleBold = 1,            /* boldface */
  40.     styleItalic = 2,        /* italic */
  41.     styleUnder = 4,            /* underline */
  42.     styleOutline = 8,        /* outline */
  43.     styleShadow = 16,        /* shadow */
  44.     styleSuper = 32,        /* superscript */
  45.     styleSub = 64,            /* subscript */
  46.     anyStyle = 128            /* high bit unused in any legal style, so */
  47.                             /* it's used to signify no style chosen */
  48. };
  49.  
  50.  
  51. /*
  52.  * A conversion format consists of a font, size and style
  53.  * combination.  It can be used in two ways, depending on its
  54.  * function in a mapping.
  55.  *
  56.  * A mapping specification consists of an input conversion format (what
  57.  * text characterists (font, size, style) to match) and an output format
  58.  * (what to map the matched input spec onto).  There is also a field
  59.  * used during specification editing to indicate whether user
  60.  * had selected the input or the output side of the mapping last.
  61.  */
  62.  
  63.  
  64. typedef struct            /* conversion format */
  65. {
  66.     int        font;        /* anyFont if none selected */
  67.     int        size;        /* anySize if none selected */
  68.     int        style;        /* anyStyle if none selected, 0 if plain */
  69.                         /* else bits = attributes selected */
  70. } ConvSpec;
  71.  
  72.  
  73. typedef struct                /* mapping specification */
  74. {
  75.     ConvSpec    inFmt;        /* input format */
  76.     ConvSpec    outFmt;        /* output format */
  77.     Boolean        isInput;    /* whether input side active or not */
  78. } MapSpec;
  79.  
  80.  
  81. /*
  82.  * Structures used for holding text representations of the conversion
  83.  * and mapping specifications
  84.  */
  85.  
  86. typedef struct                /* structure for holding text representation */
  87. {                            /* of mapping specification */
  88.     Str255    markStr;
  89.     Str255    fontStr;
  90.     Str255    sizeStr;
  91.     Str255    styleStr;
  92. } ConvStr;
  93.  
  94.  
  95. typedef struct
  96. {
  97.     ConvStr    inStr;
  98.     ConvStr    outStr;
  99. } MapStr;
  100.  
  101. # endif
  102.